package com.dmz.workflow.service;

import com.dmz.workflow.base.BaseService;
import com.dmz.workflow.entity.IntermediateNode;

import java.util.List;

public interface WorkflowNodeInfoService extends BaseService<IntermediateNode> {

    int updateNodeArriveStatus(String processInstanceId, String taskDefinitionKey, String nodeType, String taskId, Integer isArrive);

    int updateNodeTaskIdStatus(String processInstanceId, String taskDefinitionKey, String taskId, Integer arriveStatus);

    int updateNodeTaskIdCaseRefuseOperation(String processInstanceId, String taskDefinitionKey, String taskId);

    int updateNodeCaseRefuseOperation(String processInstanceId);

    List<IntermediateNode> selectIntermediateNodesByProcessInstanceId(String processInstanceId);

    int updateRepealProcessNode(String processInstanceId);

    List<IntermediateNode> queryReachableBackNodes(String processInstanceId);

    /**
     * 查询退回目前节点之后的所有节点
     * @param processInstanceId 流程实例ID
     * @param srcSort 退后的目标节点
     * @return 节点数据
     */
    List<IntermediateNode> queryBackNodes(String processInstanceId, Integer srcSort);

    /**
     * 查询已退回节点的数量
     * @param processInstanceId 流程实例ID
     * @return 退回节点的数量
     */
    int queryBackNodesNum(String processInstanceId);

    int queryProcessNodesNum(String processInstanceId);
}
